<%= javascript_include_tag "prototype" %>
<%= javascript_include_tag "util" %>
<%= javascript_include_tag "calendar" %>
<script>
        function checkNull(flag, msg_id, obj_id, msg_text){
                if (flag) {
                        if ($(obj_id).value == "")
                        {
                                $(msg_id).innerText = msg_text;
                                $(msg_id).style.display = "block";
                                return false;
                        }
                        else return true;
                }
                else {
                        $(msg_id).style.display = "none";
                }
        }
        function CheckForm(){
                return checkNull(true,'id_name','store_name','请输入仓库名');
        }
</script>
        <h1>仓库管理 - <span id="secondHeading">修改仓库信息</span></h1>
        <%= form_tag({}, :id=>"input-form") %>
        <TABLE border="0" id="INPUT-TABLE">
	<TR>
		<TD colspan="2">
			<% if @flash[:notice] -%>
			<div id="notice"><%= @flash[:notice] %></div>
			<% end -%>
		</TD>
	</TR>
        <TR>
        <input type="hidden" name="id" value="<%=@store.id%>">
      <td>仓库名:</td>
      <td><input type="text" id="store_name" name="name" value="<%=@store.name%>" size="30" maxlength="20" onfocus="checkNull(false,'id_name')" onblur="checkNull(true,'id_name',this.id,'请输入仓库名')">          <em>*</em><div class="redNsg" id="id_name" style="display:none;"></div></td>
    </tr>
    <tr>
      <td>电话:</td>
      <td><input type="text" name="phone" value="<%=@store.phone%>" size="30" maxlength="20"></td>
    </tr>
    <tr>
      <td>地址:</td>
      <td><input type="text" name="address" value="<%=@store.address%>" size="50" maxlength="50"></td>
    </tr>
    <tr>
        <td class="b">入货仓库<input id="store_in_type" name="in_type" type="checkbox" value="1" <%=' checked' if @store.in_type==1%>/></td>
        <td class="b">出货仓库<input id="store_out_type" name="out_type" type="checkbox" value="1" <%=' checked' if @store.out_type==1%>/></td>
    </tr>
    <tr>
      <td colspan="2" align="right"><input type="submit" value="修改" class="sub" onclick="return CheckForm()">&nbsp;OR&nbsp;<input type="reset" value="重新填写" class="cal"></td>
        </TR>
        </TABLE>
<p class="note"> <strong class="alert">注意：</strong><br/>
 一、有 <em>*</em> 标记的是必填项。
 </p>
     <%= end_form_tag %>
